package org.airlink.persistence.criteria.expressions
{
	import flex.persistence.criteria.Expression;
	
	import org.airlink.persistence.criteria.ExpressionImpl;
	
	public class Concat extends ExpressionImpl {

		private var x:*;
		private var y:*;
		
		public function Concat(x:*, y:*) {
			this.x = x;
			this.y = y;
		}
		
		override public function toString():String{
			var result:String = "";
			result += "concat(";
			
			//si x est une string, il faut rajouter des guillemets dans la requête
			if(x is String)
				result += "\"" + x.toString() + "\"";
			else
				result += x.toString();
			result += ",";
			if(y is String)
				result += "\"" + y.toString() + "\"";
			else
				result += y.toString();
			result += ")";
			return result;
		}
	}
}